package com.xoa.dev.efficiency.controller;

import com.xoa.model.users.Users;
import com.xoa.util.CookiesUtil;
import com.xoa.util.common.session.SessionUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

/*
Created by wuwei on 2018-07-25 07:32
* */
@Controller
@RequestMapping("/SuperSettingMain")

public class SuperSettingMainController {
    //@Resource
    //private FlowSettingHolidayService flowSettingHolidayService;
    /*@RequestMapping("/index")   //   app/flowSettingHoliday/index.jsp
    public String address() {
        return "app/dev/efficiency/setting/index";
    }*/

    @RequestMapping("/index")   //   app/flowSettingHoliday/index.jsp
    public String address(HttpServletRequest request) {
        Cookie redisSessionCookie = CookiesUtil.getCookieByName(request, "redisSessionId");
        Users users = SessionUtils.getSessionInfo(request.getSession(), Users.class, new Users(), redisSessionCookie);
        if (users.getUserPriv().equals(1)) {
            return "app/dev/efficiency/setting/index";
        }
        return "app/dev/efficiency/setting/administratorLogin";
    }

}
